(function () {
    angular.module('app')
        .component('xxUser',{
            templateUrl:'./app/user/user/user.html',
            controller:ctrl
        });

    function ctrl($scope,$state,userService) {
        $scope.username = userService.user['username'];

        $scope.home = function () {
            $state.go('user.home');
        };
        $scope.drugList = function () {
            $state.go('user.drug-list');
        };
        $scope.searchDrug = function () {
            $state.go('user.search-drug');
        };
        $scope.pharmacyInfo = function () {
            $state.go('user.pharmacy-info');
        };
        $scope.shoppingCart = function() {
            $state.go('user.shopping-cart');
        }
        $scope.orderList = function () {
            $state.go('user.order-list');
        };
        $scope.personInfo = function () {
            $state.go('user.person-info');
        };
        $scope.logout = function () {
            $state.go('login');
        };
        $scope.login = function () {
            $state.go('login');
        };
    }
})();
